//
//  NSString+Category.h
//  ChartsDemo
//
//  Created by yunda on 2021/8/7.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Category)

// 秒转时间
+ (NSString *)j_formatTimeFromSecond:(int)second;

// 时间转秒
+ (int)j_secondFromFormatTime:(NSString *)time;

/// 字符串安全
#define SAFE_STRING(S) [NSString j_safeString:S]
+ (NSString*)j_safeString:(NSString*)string;

- (BOOL)j_isMobileNumber;

- (BOOL)j_isNumber;

+ (BOOL)j_hasChinese:(NSString *)sourceStr;


#pragma mark - 简单计算textsize
- (CGSize)art_sizeWithLabelWidth:(CGFloat)width font:(UIFont *)font;
- (CGSize)art_sizeWithLabelWidth:(CGFloat)width font:(UIFont *)font maxHeight:(CGFloat)maxHeight;

- (CGSize)art_sizeWithLabelHeight:(CGFloat)height font:(UIFont *)font;
- (CGSize)art_sizeWithLabelHeight:(CGFloat)height font:(UIFont *)font maxWidth:(CGFloat)maxWidth;


/// 字符串判空
/// @param string <#string description#>
+ (BOOL)isBlankWithString:(NSString *)string;

@end

NS_ASSUME_NONNULL_END
